<template>
	<view>
		<view class="pagess">
			<uNavbar title="重拼新车" bgColor="transparent" leftIconColor="#ffffff" :titleStyle="titleStyle"></uNavbar>
			<view class="wrap">
				至少需要持有一张财神爷：<image v-if="info.available_number" src="/static/image/ishave.png" mode=""></image>
				<image v-if="!info.available_number" src="/static/image/isnohave.png" mode=""></image>
			</view>
	
			<view class="tip">
				持有财神爷卡，叠加夏小慧，每天可开24次盲盒，更能开出生态积分，助您快速拼车~
			</view>
			<view class="imagewrap" @click="gopay" >
				<image :src="info.mammon_image" mode=""></image>
			</view>
			<view class="tiptwo" @click="gopay" >
				 现在就请【财神爷】
			</view>
			<view class="btn" @click="choose" >
				重拼新车
			</view>
			<view class="rulewrap">
				<rich-text :nodes="info.rule_explanation"></rich-text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		carpoolAgainIndex,carpoolAgain
	} from "../../api/mycar.js";
	export default {
		data() {
			return {
				info:{},
				titleStyle: {
					color: '#ffffff'
				},
				
			}
		},
		onShow() {
			this.getinfo()
		},
		methods: {
			gopay(){
				uni.navigateTo({
					url:"/pagesMy/mallCenter/productDetails?id="+this.info.goods_id
				})
			},
			choose(){
				if(!this.info.available_number){
					
					uni.$u.toast("您未拥有财神爷")
				}else if(this.info.again_status==0){
					uni.$u.toast("完拼后才能重拼")
				}else{
					uni.navigateTo({
						url:"/pagesMy/nationalCarPooling/chooseCar?again=1"
					})
				}
				
			},
			// 首页数据
			submit(){
				carpoolAgain().then(res=>{
					
				})
			},
			getinfo(){
				carpoolAgainIndex().then(res=>{
					
					this.info=res.data
					console.log(res)
				})
			}

		},
	}
</script>

<style scoped lang="scss">
	.pagess {
		width: 100%;
		min-height: 100vh;
		background: #10191F;
	}
.wrap{
	font-weight: 400;
	font-size: 32rpx;
	color: #FFFFFF;
	margin-left: 32rpx;
	margin-top: 24rpx;
	display: flex;
	align-items: center;
	>image{
		width: 32rpx;
		height: 32rpx;
	}
}
.tip{
	font-weight: 400;
	font-size: 28rpx;
	color: rgba(255,255,255,0.6);
	margin-left: 32rpx;
	margin-top: 24rpx;
}
.imagewrap{
	width: 560rpx;
	height: 560rpx;
	border-radius: 14rpx 14rpx 14rpx 14rpx;
	margin: 0 auto;
	margin-top: 72rpx;
	>image{
		width: 560rpx;
		height: 560rpx;
		border-radius: 14rpx 14rpx 14rpx 14rpx;
	}
}
.tiptwo{
	font-weight: 400;
	font-size: 32rpx;
	color: #FFFFFF;
	text-align: center;
	margin-top: 24rpx;
	text-decoration-line: underline;
	text-transform: none;
}
.btn{
	margin: 0 auto;
	width: 600rpx;
	height: 80rpx;
	box-shadow: inset 0rpx 0rpx 20rpx 0rpx #1C85DB;
	border-radius: 0rpx 0rpx 0rpx 0rpx;
	font-weight: 500;
	font-size: 36rpx;
	color: #FFFFFF;
	text-align: center;
	line-height: 80rpx;
	margin-top: 30rpx;
}
.rulewrap{
	width: 680rpx;
	margin: 0 auto;
	margin-top: 50rpx;
	color: rgba(225, 225, 225, 0.6);
}
</style>